package com.woniuxy.car.boss.app.apiImpl;

import cn.hutool.core.bean.BeanUtil;
import com.woniuxy.car.boss.client.ServiceBossClient;
import com.woniuxy.car.boss.param.service.BossAddService;
import com.woniuxy.car.common.resultcode.Result;
import com.woniuxy.car.product.client.ServiceClient;
import com.woniuxy.car.product.client.param.AddService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Slf4j
public class ServiceBossApiImpl implements ServiceBossClient {
    @Resource
    private ServiceClient serviceClient;

    @Override
    public Result getAllServiceCategory() {
        log.info("无参数");
        return serviceClient.getAllServiceCategory();
    }

    @Override
    public Result searchService(List<Integer> serviceId) {
        log.info("请求参数：{}",serviceId);
        return serviceClient.searchService(serviceId);
    }

    @Override
    public Result addService(BossAddService addService) {
        log.info("请求参数：{}",addService);
        AddService addService1 = BeanUtil.copyProperties(addService, AddService.class);
        return serviceClient.addService(addService1);
    }
}
